-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for commas in values for exporter.otlp.headers #6052
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6052 +/- ##
=========================================
Coverage 91.18% 91.18%
- Complexity 5623 5627 +4
=========================================
Files 618 618
Lines 16580 16586 +6
Branches 1642 1644 +2
=========================================
+ Hits 15118 15124 +6
Misses 1013 1013
Partials 449 449 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This behavior is governed by the spec here and I would be surprised if it was changed to support this.
A couple of thoughts:
You could use a AutoConfigurationCustomizerProvider to customizer your OTLP exporters and add the headers programatically.
Someting like:
@Override
public void customize(AutoConfigurationCustomizer autoConfiguration) {
autoConfiguration.addSpanExporterCustomizer(
(spanExporter, configProperties) -> {
if (spanExporter instanceof OtlpGrpcSpanExporter) {
spanExporter.shutdown().join(10, TimeUnit.SECONDS);
return ((OtlpGrpcSpanExporter) spanExporter).toBuilder().addHeader("foo", "value,value").build();
}
return spanExporter;
});
}
There's a general moratorium on enhancing the environment variable scheme. Instead, we want to mature the file configuration scheme. There is experimental java support for file configuration in otel java as described here. The config for this type of use might look like:
# Configure tracer provider.
tracer_provider:
processors:
- batch:
exporter:
otlp:
endpoint: ..
headers:
key: "value,value"
Thanks for the reply! I'll look into your suggestion |
Thanks for the help @jack-berg, this got me unblocked. If you don't mind, I think I may update the otel-java-instrumentation example impl with the CustomizerProvider you shared. |
My use for the OpenTelemetry Java Agent requires that I pass headers with values containing commas to my otel collector. RFC 9110 section 5.5 has some verbiage on how to support this.
headerOneKey=headerOneValueA,HeaderOneValueB
headerTwoKey=headerTwoValue
could now be passed as